/**
 * Copyright (c) iwindplus Technologies Co., Ltd.2024-2030, All rights reserved.
 */

package com.iwindplus.boot.rocket.domain.dto;

import com.iwindplus.boot.domain.dto.MessageDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * rocket 消息数据传输对象.
 *
 * @param <T> 泛型
 * @author zengdegui
 * @since 2023/10/15 11:29
 */
@Schema(description = "rocket 消息数据传输对象")
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class RocketMessageDTO<T> implements Serializable {
    /**
     * 消息队列主题.
     */
    @Schema(description = "消息队列主题")
    @NotBlank(message = "{topic.notEmpty}")
    private String topic;

    /**
     * 延迟级别.
     */
    @Schema(description = "延迟级别")
    private Integer delayLevel;

    /**
     * 使用有序消息发送时，指定发送到队列
     */
    @Schema(description = "有序消息发送队列")
    private String hashKey;

    /**
     * 消息.
     */
    @Schema(description = "消息")
    private MessageDTO<T> message;
}
